/**
 * Created by liyongliang on 15/9/23.
 */
var webpack = require('webpack');
var config = require('./config').scripts;
var baseSrcPath = './' + config.srcRootPath;
var baseDestPath = './' + config.dest;
//var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
var jqueryPlugin = new webpack.ProvidePlugin({
    $: 'jquery',
    jQuery: 'jquery'
})
var UglifyJsPlugin = new webpack.optimize.UglifyJsPlugin({
    compress: {
        warnings: false
    },
    mangle: {
        except: ['$super', '$', 'exports', 'require']
    }
});
module.exports = {
	entry: {
        kola: baseSrcPath + 'kola.js',
		kaola: baseSrcPath + 'kaola.js'
	},
	output: {
		publicPath: baseDestPath,
		filename: '[name].bundle.js'
	},
	resolve: {
		extensions: ['', '.js', '.jsx']
	},
	module: {
		loaders: [{
			test: /\.js$/,
			loader: 'babel-loader'
		}, {
			test: /\.jsx$/,
			loader: 'babel-loader!jsx-loader?harmony'
		}]
	},
	plugins: [UglifyJsPlugin]
};